package com.heima.admin.controller;

import com.heima.admin.service.AdUserService;
import com.heima.model.admin.dtos.AdLoginDto;
import com.heima.model.common.dtos.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/login/in")
@Api(value = "app端用户登录",tags = "app端用户登录")
public class AdUserLoginController {

    @Autowired
    AdUserService adUserService;


    @ApiOperation("用户登录")
    @PostMapping
    public ResponseResult login(@RequestBody AdLoginDto dto) {
        log.info("用户登录: {}",dto);
        return adUserService.login(dto);
    }
}